"""OSCode URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, re_path
from OSCodeApp import views, views_admin
from django.conf.urls import url

urlpatterns = [
    path('admin/', admin.site.urls),
    re_path(r'^$', views.login),
    url(r'^viewprojects-(?P<cid>\d+)-(?P<release_time_limit>\d+)', views.view_projects),  # 按条件搜索项目
    url(r'^index', views.index),  # 主页
    url(r'^login', views.login),  # 登录注册
    url(r'^release', views.release),  # 发布项目
    url(r'^single/(?P<pid>\d+)/', views.single),  # 单个项目
    url(r'^editpwd', views.edit_pwd),  # 修改密码
    url(r'^personalcenter-(?P<cid>\d+)-(?P<release_time_limit>\d+)', views.personal_center),  # 个人中心
    url(r'^announcement/(?P<a_id>\d+)', views.single_an),  # 单条公告显示
    url(r'^personalcenter-(?P<cid>\d+)-(?P<release_time_limit>\d+)', views.personal_center),  # 按条件搜索项目

    url(r'^adminlogin', views_admin.admin),  # 管理员登陆
    url(r'^announcementmanage', views_admin.announcement_manage),  # 公告管理
    url(r'^projectmanage', views_admin.project_manage),  # 项目管理，也是管理员主页面
    url(r'^categorymanage', views_admin.category_manage),  # 类别管理

]
